package StudyCode.summary.mydatetime;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CustomFormatParseString {
	public static void main(String[] argv) {
		try {
			DateFormat formatter = new SimpleDateFormat("hh.mm.ss");
			Date date = formatter.parse("02.36.33");
			System.out.println(date);

			formatter = new SimpleDateFormat("HH:mm:ss Z");
			date = formatter.parse("22:11:12 -0500");
			System.out.println(date);
		} catch (ParseException ignored) {
			ignored.printStackTrace();
		}
	}
}
